<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">

        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

         <ui:define name="TituloModulo">
            Gestão de Financeira
        </ui:define>
        
        <ui:define name="TituloConteudoPrincipal">
            Registar Moeda
        </ui:define>

        <ui:define name="ConteudoPrincipal">
            
            <p:messages globalOnly="true"/>
            
            <h:form>
                <h:panelGrid columns="3">

                    <h:outputLabel value="#{bundle.nomeMoeda}" for="nomeMoeda" />
                    <p:inputText id="nomeMoeda" value="#{moedaController.selected.nomeMoeda}" title="#{bundle.nomeMoeda}" required="true" requiredMessage="#{bundle.obrigatorio}" />
                    <p:message for="nomeMoeda"/>
                    <h:outputLabel value="#{bundle.codMoeda}" for="codMoeda" />
                    <p:inputText id="codMoeda" value="#{moedaController.selected.codMoeda}" title="#{bundle.codMoeda}" required="true" requiredMessage="#{bundle.obrigatorio}" />
                    <p:message for="codMoeda"/>
                    <h:outputLabel value="#{bundle.cambioMoeda}" for="cambioMoeda" />
                    <p:spinner id="cambioMoeda" value="#{moedaController.selected.cambioMoeda}" title="#{bundle.cambioMoeda}" required="true" requiredMessage="#{bundle.obrigatorio}"
                               prefix="$" min="1" />
                    <p:message for="cambioMoeda"/>
                    
                </h:panelGrid>
              
                <p:commandButton  action="#{moedaController.create}" value="#{bundle.salvar}" ajax="false"/>
       
                <p:commandButton action="#{moedaController.prepareList}" value="#{bundle.listar}" immediate="true" ajax="false"/>
           
               
            </h:form>
            
        </ui:define>
    </ui:composition>

</html>
